package com.example.callgraph;
 
public aspect CallInterceptor
{
    pointcut allInterestingMethods():
        !within(CallInterceptor) && !within(CallLogger) &&
          (execution(public * *..*(..)) || execution(* *..*(..))  || execution(private * *..*(..)) || execution(protected * *..*(..)));
 
    before() : allInterestingMethods() {
        CallLogger.INSTANCE.pushMethod(thisJoinPointStaticPart.getSignature());
        CallLogger.INSTANCE.logCall();
    }
 
    after() : allInterestingMethods() {
        CallLogger.INSTANCE.popMethod();
    }
 
}